import { get } from '../get'
import { request } from '../request'
import axios from 'axios'
import { SERVER_URL } from '@/util/constant'
import Cookie from 'js-cookie'

let headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': Cookie.get('Authorization')
}

export const getWork = (pageNum, pageSize, searchModel) => {
  return get.get(`/dataQuery/${pageNum}/${pageSize}`, {
    params: searchModel
  })
}
//查询列表
export const GetworkbaseData = (pageNum, pageSize, searchModel) => {
  return get.get(`/workbase/${pageNum}/${pageSize}`, {
    params: searchModel
  })
}
//作业单位
export const GetWorkCompany = () => {
  return get.get(`/workbase/company`)
}
//国别
export const GetCountryData = () => {
  return get.get(`/workbase/country`)
}
//区域
export const GetAreaData = () => {
  return get.get(`/workbase/area`)
}
//区域
export const GetBlockData = () => {
  return get.get(`/workbase/block`)
}
//油田
export const GetOilField = () => {
  return get.get(`/workbase/oil_field`)
}
//井型、井别
export const GetWellType = (params) => {
  return get.get(`/sysmanage/datadict_name`, { params })
}


// ---------- 对比 按钮使用的接口 -----------
// 查看对比详情
export const getWellDetailCompare = (wellName) => {
  return get.get(`/dataQuery/base/${wellName}`)
}
// 参数对比
export const getCompareData = (params) => {
  return get.get(`/dataQuery/compare`, {
    params
  })
}
// 树状-国别...套管
export const getCompareTree = () => {
  return get.get(`/dataQuery/compareTree`)
}

// ---------- 数据 按钮使用的接口 -----------
// 查看数据详情
export const getWellDetailData = (wellName) => {
  return get.get(`/dataQuery/casings/${wellName}`)
}


/**
 * 查询井的所有套管尺寸
 * @param { 井名 } params 
 */
export const getWellCasingSize = (params) => {
  return get.get(`/dataQuery/casingSize_wk`, { params })
}


/**
 * 查询某口井套管尺寸的报告
 * @param { 井名, 尺寸 } params 
 */
export const getWellCasingSizeReport = (params) => {
  return get.get(`/dataQuery/report`, { params })
}


/**
 * 查询套管尺寸详情对比
 * @param { Array } params
 */
export const getGeneralDataReport = (data) => {
  return get.post(`/dataQuery/generalDataReport`, data)
}

// 树状-国别...套管
export const getCompareTreeToCasingSize = () => {
  return get.get(`/dataQuery/compareTreeToCasingSize`)
}